package symboltable;

import java.util.HashMap;

import syntaxtree.*;

public class FieldsTable {

    //cada campo possui seu id e seu simbolo
    private HashMap<Symbol, Type> hashmapFieldsTable;

    public FieldsTable() {
        hashmapFieldsTable = new HashMap<>();
    }

    public void addFields(Identifier identifier, Type type) {
        if (!hashmapFieldsTable.containsKey(Symbol.symbol(identifier.s)))
            hashmapFieldsTable.put(Symbol.symbol(identifier.s), type);
    }

    public HashMap<Symbol, Type> getHashmapFieldsTable() {
        return hashmapFieldsTable;
    }

    public void setHashmapFieldsTable(HashMap<Symbol, Type> hashmapFieldsTable) {
        this.hashmapFieldsTable = hashmapFieldsTable;
    }
}
